
const 获取输入 = async (prompt) => {
  const readline = require("readline");

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
  });

  return new Promise((resolve) => {
    rl.question(prompt, (answer) => {
      resolve(answer);
      rl.close(); // 关闭 readline 接口
    });
  });
};

module.exports = 获取输入;
